package com.action;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import metier.Imetier;
import model.Site;

import com.moteur.analysersite.validatorw3c.ErreurHtml;
import com.opensymphony.xwork2.ActionSupport;

@SuppressWarnings("serial")
public class ValidateurHtml extends ActionSupport {
	@Autowired
	private Imetier metier;

	private String url;
	List<ErreurHtml> erreurHtml;
	private com.moteur.analysersite.validatorw3c.ValidateurHtml valdcss;
	private Long idSite;
	private Site site;

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public Long getIdSite() {
		return idSite;
	}

	public void setIdSite(Long idSite) {
		this.idSite = idSite;
	}

	public void setMetier(Imetier metier) {
		this.metier = metier;
	}

	public List<ErreurHtml> getErreurHtml() {
		return erreurHtml;
	}

	public void setErreurHtml(List<ErreurHtml> erreurHtml) {
		this.erreurHtml = erreurHtml;
	}

	public String analyser() {
		this.site = this.metier.findSitebyId(this.idSite);
		valdcss = new com.moteur.analysersite.validatorw3c.ValidateurHtml(this.site.getUrl_site());
		this.erreurHtml = valdcss.analsyer();
		return "success";
	}
}
